home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15543 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Pointer to Functions and Calls thereof??
  5. Date: 19 Apr 1996 10:55:22 -0700
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4l8k2aINNg6f@keats.ugrad.cs.ubc.ca>
  8. References: <Dq01Ft.Dqn@latcs1.lat.oz.au> <4l2tlmINN822@keats.ugrad.cs.ubc.ca> <4l5p15$sl0@news1.intercall.com>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4l5p15$sl0@news1.intercall.com>,
  12. Steven Ovits <engevar@intercall.com> wrote:
  13.  >c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) wrote:
  14.  >
  15.  >> In article <Dq01Ft.Dqn@latcs1.lat.oz.au>,
  16.  >>>    {    void    *a[1];
  17.  >[snip]
  18.  >> Secondly, when you declare an array  TYPE a[1], you may only access elements
  19.  >> a[0] and a[1]. Accessing element a[2] is not allowed. The C Standard calls it
  20.  >> undefined behavior.
  21.  >> By the way, if you want an array of two functions, you can declare this:
  22.  >>    void (* funarray[3])(void);
  23.  >
  24.  >The definition TYPE a[1] has only 1 object of type TYPE named a[0].
  25.  >Similarly, void (*funarray[3])(void) is an array of 3 function
  26.  >pointers.
  27.  
  28. Heh, I really messed that one up, didn't I? I got a bunch of gleeful e-mails
  29. over it! :)
  30.